package com.lecture.springlecture.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lecture.springlecture.dao.StudentMapper;
import com.lecture.springlecture.entity.Student;
import com.lecture.springlecture.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author luyn
 * @version 1.0
 * @description
 * @date 2020/9/16 9:36
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    //@Transactional(rollbackFor = Exception.class)
    @Override
    public int updateStudent(Student student) throws InterruptedException {
        int i = studentMapper.updateStudent(student);
        System.out.println(i);
        Thread.sleep(10000);
        return i;
    }
}
